<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>使用 &lt;forTokens&gt;标签</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style>
#one {
	margin: auto;
	background: url(jstl/images/logo.jpg);
	background-repeat: no-repeat;
	height: 492px;
	width: 722px;
}

#two {
	position: relative;
	font-size: 12px;
	margin-top: 150px;
	margin-left: 190px;
	width: 500px;
	float: left;
	font-size: 16px;
}

#three {
	position: relative;
	width: 200px;
	margin-top: 150px;
	margin-right: 60px;
	float: right;
}
</style>

</head>

<body>
	演示jsp页面使用循环jstl标签实现循环显示逻辑控制
	<br> 注意它与foreach签的不同点
	<hr>
	<div id="one">
		<div id="two">
			<c:set value="Java入门经典、Oracle学习手册、C#编程基础、轻松学Linux、ASP.NET实践"
				var="params"></c:set>
			<b>原字符串：</b><br>
			<c:out value="${params }"></c:out>
			<br> <b>分割后的字符串：</b><br>
			<!-- 统一的分割处理，从整体中识别集合，再迭代处理集合中的元素 -->
			<c:forTokens items="${params }" delims="、" var="c1">
				<c:out value="${c1}"></c:out>
				<br>
			</c:forTokens>
			<br>

		</div>
		<div id="three"></div>
	</div>


</body>
</html>
